<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
    <head>
        <!-- 加载部部样式及META信息 -->
        <title>管理员</title>
        <div th:replace="common/meta"></div>
        <style>
            .control-label {
                text-align: right;
            }

            .content {
                min-height: auto;
            }
        </style>
        <script>
            require.config.jsname = "backend/menu/rule";
            require.config.modulename = "admin"
            require.config.controllername = "auth.admin"
            require.config.actionname = "add"
            require.config.moduleurl = "/admin/add"
        </script>
    </head>
    <body class="inside-header inside-aside is-dialog">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    控制台
                                    <small>Control panel</small>
                                </h1>
                            </section>
                            <div class="content">
                                <form id="edit-form" class="form-horizontal form-ajax" role="form" method="POST" action="/sys/menu/save">
                                    <div class="form-group">
                                        <label for="content" class="control-label col-xs-12 col-sm-2">菜单:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <label for="row[ismenu]-2">
                                                <input id="row[ismenu]-2" checked="checked" name="onemenu" type="radio" value="2">
                                                按钮
                                            </label>
                                            <label for="row[ismenu]-1">
                                                <input id="row[ismenu]-1"  name="onemenu" type="radio" value="1">
                                                父菜单
                                            </label>
                                            <label for="row[ismenu]-0">
                                                <input id="row[ismenu]-0" name="onemenu" type="radio" value="0">
                                                子菜单
                                            </label>

                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label  class="control-label col-xs-12 col-sm-2">父级:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <select class="form-control selectpicker" required="" name="pid">
                                                <option value="0" >无</option>
                                                <option th:each="resource: ${resources}" th:value="${resource.id}" th:text="${resource.title}"></option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="name" class="control-label col-xs-12 col-sm-2">规则URL:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input type="text" class="form-control" id="name" name="url" value="" data-rule="required"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label  class="control-label col-xs-12 col-sm-2">标题:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input type="text" class="form-control" id="title" name="title" value="" data-rule="required"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="icon" class="control-label col-xs-12 col-sm-2">图标:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <div class="input-group input-groupp-md">
                                                <input type="text" class="form-control" id="icon" name="icon" value="fa fa-cogs"/>
                                                <a href="javascript:;" class="btn-search-icon input-group-addon">搜索图标</a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="weigh" class="control-label col-xs-12 col-sm-2">权重:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input type="text" class="form-control" id="weigh" name="weight" value="1" data-rule="required"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="content" class="control-label col-xs-12 col-sm-2">状态:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <label for="row[status]-normal">
                                                <input id="row[status]-normal" checked="checked" name="status" type="radio" value="1">
                                                正常
                                            </label>
                                            <label for="row[status]-hidden">
                                                <input id="row[status]-hidden" name="status" type="radio" value="0">
                                                隐藏
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group hidden layer-footer">
                                        <div class="col-xs-2"></div>
                                        <div class="col-xs-12 col-sm-8">
                                            <button type="submit" class="btn btn-success btn-embossed disabled">确定</button>
                                            <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                        </div>
                                    </div>
                                </form>
                                <style>
                                    #chooseicon {
                                        margin: 10px;
                                    }

                                    #chooseicon ul {
                                        margin: 5px 0 0 0;
                                    }

                                    #chooseicon ul li {
                                        width: 30px;
                                        height: 30px;
                                        line-height: 30px;
                                        border: 1px solid #ddd;
                                        padding: 1px;
                                        margin: 1px;
                                        text-align: center;
                                    }

                                    #chooseicon ul li:hover {
                                        border: 1px solid #2c3e50;
                                        cursor: pointer;
                                    }
                                </style>
                                <script id="chooseicontpl" type="text/html">
                                    <div id="chooseicon">
                                        <div>
                                            <form onsubmit="return false;">
                                                <div class="input-group input-groupp-md">
                                                    <div class="input-group-addon">搜索图标</div>
                                                    <input class="js-icon-search form-control" type="text" placeholder="">
                                                </div>
                                            </form>
                                        </div>
                                        <div>
                                            <ul class="list-inline">
                                                <% for(var i=0; i<iconlist.length; i++){ %>
                                                <li data-font="<%=iconlist[i]%>" title="<%=iconlist[i]%>">
                                                    <i class="fa fa-<%=iconlist[i]%>"></i>
                                                </li>
                                                <% } %>
                                            </ul>
                                        </div>

                                    </div>
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="assets/js/require.min.js" data-main="assets/js/require-backend.min.js"></script>
</body>
<div th:replace="common/script"></div>
</html>